<template>
  <div class="wrap">
    <imglist :articles="articles" :limit="limit"></imglist>
  </div>
</template>

<script>
import Imglist from '~/components/Soocimglist.vue'
export default {
  async asyncData({store, route}) {
    let page = route.params.id || 1
    let data = await store.dispatch('ARTICLES', page , 4)
    if(data.success) {
      return {
        articles: data.data,
        limit:4
      }
    } else {
      return {
        articles: [],
        limit:0
      }
    }
  },

  components: {
    Imglist
  }
}

</script>
